<template>
  <!-- 访客记录-详情 -->
  <div>
    <public-modal
      width="1000px"
      :footer="false"
      title=" 详情页"
      modalStyle="detailModal"
      :publicVisible="publicVisible"
      cancelContext="拒绝"
      confirmContext="通过"
      @handleOk="handleOk"
      @cancel="cancel"
    >
      <div slot="content">
        <div class="common-title">
          <div class="icon"></div>
          <div class="content">单位信息</div>
        </div>
        <div class="content-wrapper">
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">单位名称</div>
              <div class="value common-value">{{ companyMessage.companyMessage || '暂无' }}</div>
            </div>
          </div>
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">详细地址</div>
              <div class="value common-value">{{ companyMessage.communityName || '暂无' }}</div>
            </div>
          </div>

          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">单位负责人</div>
              <div class="value common-value">{{ companyMessage.dutyPersonName || '暂无' }}</div>
            </div>
            <div class="info-wrap f1">
              <div class="label common-lable">联系电话</div>
              <div class="value common-value">
                {{ companyMessage.mobile || '暂无' }}
              </div>
            </div>
          </div>
        </div>

        <div class="common-title">
          <div class="icon"></div>
          <div class="content">开锁信息</div>
        </div>
        <div class="content-wrapper">
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">业主姓名</div>
              <div class="value common-value">{{ unlockRecord.ownerName || '暂无' }}</div>
            </div>
            <div class="info-wrap f1">
              <div class="label common-lable">联系电话</div>
              <div class="value common-value">
                {{ `${unlockRecord.phoneNumber}` || '暂无' }}
              </div>
            </div>
          </div>
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">开锁地址</div>
              <div class="value common-value">{{ unlockRecord.mapPoint + unlockRecord.detailedAddress || '暂无' }}</div>
            </div>
          </div>
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">开锁时间</div>
              <div class="value common-value">
                {{ moment(unlockRecord.unlockTime).format('YYYY/MM/DD HH:mm') || '暂无' }}
              </div>
            </div>
          </div>
        </div>
        <!-- 如果有重点房屋信息 -->
        <div class="common-title">
          <div class="icon"></div>
          <div class="content">上报信息</div>
        </div>
        <div class="content-wrapper">
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">上报时间</div>
              <div class="value common-value">{{ unlockRecord.reportTime || '暂无' }}</div>
            </div>
          </div>
        </div>
      </div>
      <div slot="footer"></div>
    </public-modal>
  </div>
</template>
<script>
import startEndTime from '@/components/startEndTime'
import publicModal from '@/components/publicModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { machinePrintRecordDetails } from '@/api/api'
import { getIdUnlockRecord, oilSaleRecordDetails, wasteRecyclingRecordDetails } from '../../../../api/api'
import moment from 'moment'

export default {
  name: 'houseDetail',
  components: { publicModal, startEndTime },
  mixins: [JeecgListMixin],
  data() {
    return {
      url: {
        list: '/common/project_company_serve_record/page',
      },
      publicVisible: false,
      columns: [
        {
          title: '服务名称',
          dataIndex: 'serveTitle',
          ellipsis: true,
          align: 'center',
        },
        {
          title: '服务时段',
          align: 'center',
          width: 400,
          scopedSlots: { customRender: 'time' },
          ellipsis: true,
        },
        {
          title: '服务民(辅)警',
          align: 'center',
          dataIndex: 'policeUserNames',
          ellipsis: true,
        },
        {
          title: '操作',
          scopedSlots: { customRender: 'action' },
          align: 'center',
        },
      ],
      project_company_type: [],
      queryParams: { pageSize: 5 },
      ipagination: { pageSize: 5 },
      disableMixinCreated: true,
      isTsyfwinfo: {},
      policeHouseMainsList: {},
      companyMessage: {},
      unlockRecord: {},
    }
  },

  methods: {
    moment,
    async show(records) {
      this.publicVisible = true
      this.getDetail(records)
    },
    getDetail(records) {
      const params = {
        id: records.id,
      }
      getIdUnlockRecord(params).then((res) => {
        if (res.code == 200) {
          const { companyMessage, unlockRecord } = res.result
          this.companyMessage = companyMessage
          this.unlockRecord = unlockRecord
        } else {
        }
      })
    },
    handleOk() {
      this.publicVisible = false
    },

    cancel(target) {
      this.publicVisible = false
    },
  },
}
</script>
<style scoped lang="less">
/deep/ .modalCotent {
  padding: 20px 40px;
  border-radius: 0 0 4px 4px;
}

.img-style-wrapper {
  width: 140px;
  height: 124px;
  border-radius: 8px 8px 8px 8px;
  object-fit: cover;
}
</style>
